package com.technology.education.ui.student.course

import androidx.lifecycle.MutableLiveData
import com.technology.education.data.model.CollectCourseModel
import com.technology.education.data.model.CourseCategory
import com.technology.education.network.apiService
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.ext.request
import me.hgj.jetpackmvvm.state.ResultState

/**
 *@author:create by BZY
 *Date: 2022/3/11 10
 */
class CourseListViewModel : BaseViewModel() {
    var categoryList: ArrayList<CourseCategory>? = null
    var selectCategory = ""
    val result=MutableLiveData<ResultState<CollectCourseModel>>()

    override fun getData() {
        super.getData()
        request({
            apiService.courseList(
                hashMapOf(
                    "pageNo" to pageIndex,
                    "pageSize" to pageSize,
                    "cateId2" to selectCategory
                )
            )
        },result)
    }
}